package com.hackordie.daos.mappers;

import java.sql.ResultSet;
import java.sql.SQLException;

import org.springframework.jdbc.core.RowMapper;

import com.hackordie.commons.authorities.Profile;

public class ProfileMapper implements RowMapper<Profile> {

	@Override
	public Profile mapRow(final ResultSet result, final int row) throws SQLException {
		Profile profile = new Profile();
		profile.setId(result.getInt("idProfile"));
		profile.setName(result.getString("name"));
		profile.setSurnames(result.getString("surnames"));
		profile.setBirthDay(result.getDate("birthday"));
		profile.setGender(result.getString("gender"));
		profile.setAvatar(result.getString("avatar"));
		return profile;
	}

}
